﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_RptSoCaiTaiKhoan : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CbChon")]
        private CheckBox _CbChon;
        [AccessedThroughProperty("CboCapTaiKhoan")]
        private ComboBox _CboCapTaiKhoan;
        [AccessedThroughProperty("CboDonVi")]
        private ComboBox _CboDonVi;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("CmdPrint")]
        private Button _CmdPrint;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtSearchCode")]
        private TextBox _TxtSearchCode;
        [AccessedThroughProperty("TxtSearchName")]
        private TextBox _TxtSearchName;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSList")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSList;
        public bool bLoaded;
        private object cFrmCall;
        private DataView cFrmData;
        private string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnableControl;
        private clsDMTaiKhoan objDMTK;
        private string pKhoaDoiTuong;

        public Frm_RptSoCaiTaiKhoan()
        {
            base.Load += new EventHandler(this.Frm_SoCaiChiTietTaiKhoan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.bLoaded = false;
            this.cFrmKhoaOld = "";
            this.cFrmKhoa = "";
            this.pKhoaDoiTuong = "";
            this.cFrmTask = "";
            this.mAllowEdit = true;
            this.mAllowDel = false;
            this.objDMTK = new clsDMTaiKhoan();
            this.InitializeComponent();
        }

        private void CbChon_CheckedChanged(object sender, EventArgs e)
        {
            bool flag = this.CbChon.Checked;
            int num2 = this.VSList.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                this.VSList[i, 1] = flag;
            }
        }

        private void CboCapTaiKhoan_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.LoadData();
        }

        public bool checkIvalid()
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboCapTaiKhoan.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                bool flag=false;
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn cấp t\x00e0i khoản trước!", ""));
                this.CboCapTaiKhoan.Focus();
                return flag;
            }
            return true;
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            this.Xem();
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            this.PrintReport();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_SoCaiChiTietTaiKhoan_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.Cursor = Cursors.WaitCursor;
                BuildComboModule.BuildCombo(this.CboDonVi, modGeneral.ListDanhMuc.DonVi, true, "", "");
                this.CboDonVi.SelectedValue = modGeneral.H_CLIENT;
                this.CboCapTaiKhoan.Items.AddRange(new object[] { modGeneral.Tranlated("T\x00e0i khoản cấp 1", ""), modGeneral.Tranlated("T\x00e0i khoản cấp 2", ""), modGeneral.Tranlated("T\x00e0i khoản cấp 3", ""), modGeneral.Tranlated("T\x00e0i khoản cấp 4", "") });
                this.CboCapTaiKhoan.SelectedIndex = 0;
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                this.LoadData();
                this.Cursor = Cursors.Default;
            }
        }

        public DataTable GetData(string pKhoaBC)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[4];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, modGeneral.H_CLIENT);
                commandParameters[1] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, LVYModule.Date2Char(this.TxtTuNgay.Text));
                commandParameters[2] = DBHelper.createParameter("@DenNgay", DbType.Double, ParameterDirection.Input, LVYModule.Date2Char(this.TxtDenNgay.Text));
                commandParameters[3] = DBHelper.createParameter("@KhoaBaoCao", DbType.Int64, ParameterDirection.Input, pKhoaBC);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "GL_BC_SoCaiChiTiet", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public void InitDataDanhMuc(string pKhoaBaoCao)
        {
            string str = "";
            string str3 = "";
            DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.Text, " DELETE FROM BC_DuLieuDanhMuc ", new IDataParameter[0]);
            int num3 = this.VSList.Rows.Count - 1;
            for (int i = 0; i <= num3; i++)
            {
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSList[i, 1])) != 0.0)
                {
                    str = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 2]), "", modGeneral.TypeOfValue.String).ToString().Trim();
                    str3 = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSList[i, 3]), "", modGeneral.TypeOfValue.String).ToString().Trim();
                    int length = str.Trim().Length;
                    string commandText = " INSERT INTO BC_DuLieuDanhMuc(KhoaDanhMuc, KhoaBaoCao, Loai, MaDanhMuc, TenDanhMuc)  SELECT Khoa, '" + pKhoaBaoCao + "', '', '" + str + "', N'" + str3 + "' FROM DM_TaiKhoan WHERE LEFT(SoTaiKhoan," + length.ToString() + ") = '" + str + "'";
                    DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]);
                }
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_RptSoCaiTaiKhoan));
            this.CboDonVi = new ComboBox();
            this.GroupBox1 = new GroupBox();
            this.Label1 = new Label();
            this.CboCapTaiKhoan = new ComboBox();
            this.CbChon = new CheckBox();
            this.TxtSearchName = new TextBox();
            this.TxtSearchCode = new TextBox();
            this.TxtDenNgay = new DateTimePicker();
            this.TxtTuNgay = new DateTimePicker();
            this.VSList = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Label13 = new Label();
            this.Label2 = new Label();
            this.Label3 = new Label();
            this.CmdOK = new Button();
            this.CmdCancel = new Button();
            this.CmdPrint = new Button();
            this.GroupBox1.SuspendLayout();
            this.VSList.BeginInit();
            this.SuspendLayout();
            this.CboDonVi.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboDonVi.FormattingEnabled = true;
            Point point = new Point(0x5e, 15);
            this.CboDonVi.Location = point;
            this.CboDonVi.Name = "CboDonVi";
            Size size = new Size(0x132, 0x15);
            this.CboDonVi.Size = size;
            this.CboDonVi.TabIndex = 0x3a;
            this.GroupBox1.BackColor = Color.Transparent;
            this.GroupBox1.Controls.Add(this.CboDonVi);
            this.GroupBox1.Controls.Add(this.Label1);
            this.GroupBox1.Controls.Add(this.CboCapTaiKhoan);
            this.GroupBox1.Controls.Add(this.CbChon);
            this.GroupBox1.Controls.Add(this.TxtSearchName);
            this.GroupBox1.Controls.Add(this.TxtSearchCode);
            this.GroupBox1.Controls.Add(this.TxtDenNgay);
            this.GroupBox1.Controls.Add(this.TxtTuNgay);
            this.GroupBox1.Controls.Add(this.VSList);
            this.GroupBox1.Controls.Add(this.Label13);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.Label3);
            point = new Point(7, 3);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(0x1c1, 0x1bb);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0x3e;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "Tuỳ chọn";
            this.Label1.AutoSize = true;
            point = new Point(13, 0x12);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x26, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x39;
            this.Label1.Text = "Đơn vị";
            this.CboCapTaiKhoan.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboCapTaiKhoan.FormattingEnabled = true;
            point = new Point(0x5e, 0x27);
            this.CboCapTaiKhoan.Location = point;
            this.CboCapTaiKhoan.Name = "CboCapTaiKhoan";
            size = new Size(0x132, 0x15);
            this.CboCapTaiKhoan.Size = size;
            this.CboCapTaiKhoan.TabIndex = 0x38;
            this.CbChon.AutoSize = true;
            point = new Point(15, 0x5c);
            this.CbChon.Location = point;
            this.CbChon.Name = "CbChon";
            size = new Size(15, 14);
            this.CbChon.Size = size;
            this.CbChon.TabIndex = 0x37;
            this.CbChon.UseVisualStyleBackColor = true;
            point = new Point(0x80, 0x1a2);
            this.TxtSearchName.Location = point;
            this.TxtSearchName.Name = "TxtSearchName";
            size = new Size(0x13c, 20);
            this.TxtSearchName.Size = size;
            this.TxtSearchName.TabIndex = 0x34;
            point = new Point(8, 0x1a2);
            this.TxtSearchCode.Location = point;
            this.TxtSearchCode.Name = "TxtSearchCode";
            size = new Size(0x6d, 20);
            this.TxtSearchCode.Size = size;
            this.TxtSearchCode.TabIndex = 0x33;
            this.TxtDenNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x10a, 0x40);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x57, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x2d;
            this.TxtTuNgay.Format = DateTimePickerFormat.Short;
            point = new Point(0x5e, 0x3f);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x55, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 0x2c;
            DateTime time = new DateTime(0x7d7, 7, 1, 0, 0, 0, 0);
            this.TxtTuNgay.Value = time;
            this.VSList.AutoResize = false;
            this.VSList.BackColor = Color.WhiteSmoke;
            this.VSList.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSList.ColumnInfo = manager.GetString("VSList.ColumnInfo");
            this.VSList.ExtendLastCol = true;
            this.VSList.FocusRect = FocusRectEnum.None;
            point = new Point(6, 0x59);
            this.VSList.Location = point;
            this.VSList.Name = "VSList";
            this.VSList.Rows.Count = 1;
            this.VSList.Rows.DefaultSize = 0x11;
            this.VSList.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x1b7, 0x145);
            this.VSList.Size = size;
            this.VSList.StyleInfo = manager.GetString("VSList.StyleInfo");
            this.VSList.TabIndex = 50;
            this.VSList.VisualStyle = VisualStyle.Office2007Blue;
            this.Label13.AutoSize = true;
            point = new Point(14, 0x44);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x2e;
            this.Label13.Text = "Từ ng\x00e0y";
            this.Label2.AutoSize = true;
            point = new Point(13, 0x2a);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x49, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x31;
            this.Label2.Text = "Cấp t\x00e0i khoản";
            this.Label3.AutoSize = true;
            point = new Point(0xc5, 0x43);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x35, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x2f;
            this.Label3.Text = "Đến ng\x00e0y";
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(7, 0x1c1);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(80, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 0x3f;
            this.CmdOK.Text = "&Chi tiết";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x179, 0x1c1);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4f, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x40;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x5b, 0x1c1);
            this.CmdPrint.Location = point;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(80, 0x18);
            this.CmdPrint.Size = size;
            this.CmdPrint.TabIndex = 0x41;
            this.CmdPrint.Text = "&Trang in";
            this.CmdPrint.UseVisualStyleBackColor = true;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x1cf, 0x1de);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.CmdOK);
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdPrint);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_RptSoCaiTaiKhoan";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-TH01";
            this.Text = "SO CAI TAI KHOAN";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.VSList.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            this.cFrmData = new DataView(this.objDMTK.ShowListByField("Khoa|0 as Chon|SoTaiKhoan|Ten" + modGeneral.H_LANGUAGE + "", " CapDo = " + Conversions.ToString((int) (this.CboCapTaiKhoan.SelectedIndex + 1)), " SoTaiKhoan"));
            if (this.cFrmData != null)
            {
                this.VSList.DataSource = this.cFrmData;
                C1.Win.C1FlexGrid.C1FlexGrid vSList = this.VSList;
                vSList[0, 1] = "";
                vSList[0, 2] = modGeneral.Tranlated("Số t\x00e0i khoản", "");
                vSList[0, 3] = modGeneral.Tranlated("T\x00ean t\x00e0i khoản", "");
                vSList.Cols[0].Visible = false;
                vSList.Cols[1].DataType = System.Type.GetType("System.Boolean");
                vSList.Cols[1].Width = 30;
                vSList = null;
            }
        }

        public void PrintReport()
        {
            string pKhoaBaoCao = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            this.InitDataDanhMuc(pKhoaBaoCao);
            DataTable dataTable = new DataTable();
            dataTable = this.GetData(pKhoaBaoCao);
            if (dataTable != null)
            {
                if (dataTable.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    Rpt_SoCaiChiTiet tiet = new Rpt_SoCaiChiTiet();
                    try
                    {
                        tiet.SetDataSource(dataTable);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            tiet.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            tiet.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        tiet.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                        tiet.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                        tiet.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                        tiet.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                        tiet.SetParameterValue(5, modGeneral.Tranlated("SỔ C\x00c1I T\x00c0I KHOẢN", ""));
                        tiet.SetParameterValue(6, modGeneral.Tranlated("Từ ng\x00e0y ", "") + ":" + this.TxtTuNgay.Text + " " + modGeneral.Tranlated("đến ng\x00e0y ", "") + " : " + this.TxtDenNgay.Text);
                        tiet.SetParameterValue(7, modGeneral.Tranlated("T\x00ean t\x00e0i khoản", ""));
                        tiet.SetParameterValue(8, modGeneral.Tranlated("Số dư đầu kỳ", ""));
                        tiet.SetParameterValue(9, modGeneral.Tranlated("Số dư cuối kỳ", ""));
                        tiet.SetParameterValue(10, modGeneral.Tranlated("Tổng cộng", ""));
                        tiet.SetParameterValue(11, modGeneral.Tranlated("Số chứng từ", ""));
                        tiet.SetParameterValue(12, modGeneral.Tranlated("Ng\x00e0y", ""));
                        tiet.SetParameterValue(13, modGeneral.Tranlated("Diễn giải", ""));
                        tiet.SetParameterValue(14, modGeneral.Tranlated("TK đối", ""));
                        tiet.SetParameterValue(15, modGeneral.Tranlated("Ph\x00e1t sinh nợ ", ""));
                        tiet.SetParameterValue(0x10, modGeneral.Tranlated("Ph\x00e1t sinh c\x00f3", ""));
                        tiet.SetParameterValue(0x11, modGeneral.Tranlated("Lập biểu", ""));
                        tiet.SetParameterValue(0x12, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                        tiet.SetParameterValue(0x13, modGeneral.Tranlated("Gi\x00e1m đốc", ""));
                        tiet.SetParameterValue(20, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = tiet;
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        if (Form.ActiveForm != null)
                        {
                            Form.ActiveForm.Cursor = Cursors.Default;
                        }
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        public void SearchTaiKhoan(string field, string str)
        {
            string str2 = field + " LIKE '" + str + "%'";
            this.cFrmData.RowFilter = str2;
            if (this.VSList.Rows.Count != 1)
            {
                this.VSList.Select(1, 0, 1, this.VSList.Cols.Count - 1);
            }
        }

        private void TxtSearchCode_TextChanged(object sender, EventArgs e)
        {
            this.SearchTaiKhoan("SoTaiKhoan", this.TxtSearchCode.Text);
        }

        private void TxtSearchName_TextChanged(object sender, EventArgs e)
        {
            this.SearchTaiKhoan("TenViet", this.TxtSearchName.Text);
        }

        private void TxtTuNgay_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.sRight(this.TxtTuNgay.Text, 7) != LVYModule.sRight(this.TxtDenNgay.Text, 7))
            {
                this.TxtDenNgay.Text = DateTime.DaysInMonth(Conversions.ToInteger(LVYModule.sRight(this.TxtTuNgay.Text, 4)), Conversions.ToInteger(LVYModule.sMid(this.TxtTuNgay.Text, 4, 2))).ToString() + "/" + LVYModule.sRight(this.TxtTuNgay.Text, 7);
            }
        }

        private void VSList_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (e.Col != 1)
            {
                e.Cancel = true;
            }
        }

        public void Xem()
        {
            string pKhoaBaoCao = modGeneral.CreatKey("BC_DuLieuDanhMuc", 10, "");
            this.InitDataDanhMuc(pKhoaBaoCao);
            DataTable data = new DataTable();
            data = this.GetData(pKhoaBaoCao);
            if (data != null)
            {
                string str2 = " " + modGeneral.Tranlated("từ ng\x00e0y", "") + ": " + this.TxtTuNgay.Text + "  " + modGeneral.Tranlated("đến ng\x00e0y", "") + ": " + this.TxtDenNgay.Text + " ";
                MyProject.Forms.Frm_SoCaiChiTietTaiKhoan.Label2.Text = str2;
                MyProject.Forms.Frm_SoCaiChiTietTaiKhoan.pData = data;
                MyProject.Forms.Frm_SoCaiChiTietTaiKhoan.ShowDialog();
            }
        }

        internal virtual CheckBox CbChon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CbChon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CbChon_CheckedChanged);
                if (this._CbChon != null)
                {
                    this._CbChon.CheckedChanged -= handler;
                }
                this._CbChon = value;
                if (this._CbChon != null)
                {
                    this._CbChon.CheckedChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboCapTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboCapTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboCapTaiKhoan_SelectedIndexChanged);
                if (this._CboCapTaiKhoan != null)
                {
                    this._CboCapTaiKhoan.SelectedIndexChanged -= handler;
                }
                this._CboCapTaiKhoan = value;
                if (this._CboCapTaiKhoan != null)
                {
                    this._CboCapTaiKhoan.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboDonVi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboDonVi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboDonVi = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual Button CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual TextBox TxtSearchCode
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchCode;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSearchCode_TextChanged);
                if (this._TxtSearchCode != null)
                {
                    this._TxtSearchCode.TextChanged -= handler;
                }
                this._TxtSearchCode = value;
                if (this._TxtSearchCode != null)
                {
                    this._TxtSearchCode.TextChanged += handler;
                }
            }
        }

        internal virtual TextBox TxtSearchName
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSearchName;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSearchName_TextChanged);
                if (this._TxtSearchName != null)
                {
                    this._TxtSearchName.TextChanged -= handler;
                }
                this._TxtSearchName = value;
                if (this._TxtSearchName != null)
                {
                    this._TxtSearchName.TextChanged += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTuNgay_LostFocus);
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus -= handler;
                }
                this._TxtTuNgay = value;
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSList_BeforeEdit);
                if (this._VSList != null)
                {
                    this._VSList.BeforeEdit -= handler;
                }
                this._VSList = value;
                if (this._VSList != null)
                {
                    this._VSList.BeforeEdit += handler;
                }
            }
        }
    }
}

